package com.kunchi.oms.order.api;

import com.kunchi.isb.base.exception.ISBException;
import com.kunchi.isb.base.result.ISBResult;
import com.kunchi.isb.service.ISBJsonParamService;
import com.kunchi.oms.order.po.Order;
import com.kunchi.oms.order.service.OrderService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "根据订单状态查询",tags = "OrderFindStatus",description = "订单状态查询订单信息")
@RestController
@RequestMapping("/oms/OrderFindStatus")
public class OrderFindStatusApi extends ISBJsonParamService<Order, List<Order>> {
    @Autowired
    OrderService orderService;
    @Override
    protected ISBResult doService(ISBResult<List<Order>> isbResult, Order order) throws ISBException {
        isbResult.setBody(orderService.findByStatusAndPrice(order));
        return isbResult;
    }
}
